import mpTagApi from "@/api/declaration/mp/mpTagApi"
import httpRequest from "@/config/axios/httpRequest"
import { MpTagModel } from "@/models/mp/MpTagModel"

// 创建公众号标签
export const createTag = (data: MpTagModel) => {
  return httpRequest.post(mpTagApi.CreateTag, data)
}

// 更新公众号标签
export const updateTag = (data: MpTagModel) => {
  return httpRequest.put(mpTagApi.UpdateTag, data)
}

// 删除公众号标签
export const deleteTag = (id: number) => {
  return httpRequest.delete(mpTagApi.DeleteTag, {params: {id}})
}

// 获得公众号标签
export const getTag = (id: number) => {
  return  httpRequest.get(mpTagApi.GetTag, {params: {id}})
}

// 获得公众号标签分页
export const getTagPage = (query: PageParam) => {
  return httpRequest.get(mpTagApi.GetTagPage, {params: query})
}

// 获取公众号标签精简信息列表
export const getSimpleTagList = () => {
  return httpRequest.get(mpTagApi.GetSimpleTagList)
}

// 同步公众号标签
export const syncTag = (accountId: number) => {
  return httpRequest.post(mpTagApi.SyncTag, {accountId})
}
